home *** CD-ROM | disk | FTP | other *** search
- /* PARSFNM.C --- p. 645 */
- #include <stdio.h>
- #include <dos.h>
- main()
- {
- char input[80], *rest;
- int option; /* Option for parsfnm */
- struct fcb fcb; /* File Control Block, FCB */
- printf("Enter string containing file name to be"
- "parsed\n(for example, A:MYFILE.DAT):");
- gets(input);
- /* Parse file name using 'pardfnm' and FCB */
- option = 1; /* means skip leading separators */
- rest = parsfnm(input, &fcb, option);
- /* Print results from the fcb structure */
- printf( "Drive number: %d\n"
- "File name: %s\n"
- "Extension: %s\n", fcb.fcb_drive,
- fcb.fcb_name, fcb.fcb_ext);
- printf("Rest of the input line = %s\n", rest);
- }